<?php
	$root = $_SERVER['DOCUMENT_ROOT'];
	include($root . "/util/session.php");
	include($root . "/util/privilege_check.php");
	checkPrivilege("admin");
	$subjectID=mysqli_real_escape_string($db,$_GET['subjectID']);
	$degreeID=mysqli_real_escape_string($db,$_GET['degreeID']);
	$studentID=mysqli_real_escape_string($db,$_GET['studentID']);
	$sql="delete from students_subjects where degreeID='$degreeID' and subjectID='$subjectID' and studentID='$studentID'";
	$result=mysqli_query($db,$sql);
	header("Refresh:3; url=/admin/subjectList.php?degreeID=" . $degreeID);
	if($result){
		echo '<h1>Student removed from subject, going back in 3 seconds...<h1>';
	}
	else{
		echo '<h1>Student not removed from subject, going back in 3 seconds...<h1>';
	}
?>
